<template>
    <a-card :bordered="false">
        <div class="table-operator">
            <a-button shape="round" size="small" type="primary" icon="plus" @click="addMenu">新增</a-button>
        </div>
        <LTable
            ref="ipcMenuList"
            size="small"
            rowKey="keyId"
            :columns="columns"
            :initQuery="initQuery"
            axiosUrl="/WxIpcMenuController/ipcMenuTableTree"
            :showPagination="false"
            :showQueryForm="false"
            :isAutoLoad="true"
        >
            <span slot="action" slot-scope="text, record">
                <a @click="handleEdit(record,'ipcMenuForm',record.menuTitle)">编辑</a>
            </span>
        </LTable>
        <ipcMenuForm ref="ipcMenuForm" @close="refresh('ipcMenuList')" @ok="refresh('ipcMenuList')"></ipcMenuForm> 
        <ipcOnlyofficeEditForm ref="ipcOnlyofficeEditForm" @close="refresh('ipcMenuList')" @ok="refresh('ipcMenuList')"></ipcOnlyofficeEditForm> 
    </a-card>
        
    </template>
    
    <script>
    import LTable from '@/components/lt/LTable'
    import {SysMixin} from '@/mixins/SysMixin'
    import defaultSettings from '@/config/defaultSettings'
    import ipcMenuForm from './ipcMenuForm'
    import ipcOnlyofficeEditForm from './ipcOnlyofficeEditForm'
    import request from '@/utils/request'
    export default {
        name:'ipcMenuList',
        components: {
            LTable,ipcMenuForm,ipcOnlyofficeEditForm
        },
        mixins:[SysMixin],
        data(){
            return{
                defaultSettings,
                initQuery:[{field:'systemNo',val:defaultSettings.systemNo}],
                columns:[
                    {
                        title: '设备标题',
                        dataIndex: 'menuTitle'
                    },
                    {
                        title: '排序',
                        dataIndex: 'sortNo', 
                    },
                   
                    {
                        title: '操作',
                        dataIndex: 'action',
                        width: '280px',
                        scopedSlots: { customRender: 'action' }
                    }
                ]
    
            }
        },
        methods:{
            addMenu(){
                this.handleEdit({},'ipcMenuForm','新增')
            },
        },
      
        
    }
    </script>